﻿@model SelfMadeMillionaire.Web.Infrastructure.ViewModels.Account.PasswordRecoveryModel
@{
	ViewBag.Title = "Password Recovery";
}

<div class="row">
	<div class="col-sm-12 col-md-12 col-lg-12">

		<!--left content block-->
		<div class="left_col_block">
            <div class="content_block_title">
				<h5>Forgot Password?</h5>
				<div class="title_bottom_arrow">
					<img src="@Url.Content("~/Content/images/down_arrow.png")" alt="" /></div>
			</div>

            <div class="biography_container">
				@using (Html.BeginForm("PasswordRecovery", "Account", new { ReturnUrl = ViewBag.ReturnUrl }, FormMethod.Post, new { @class = "form-horizontal", role = "form" }))
                {
					<div class="login_block">
                        <div style="margin-bottom:8px;">
                        Please enter the email address you used to register, then we will <br />
                        send you a link to choose a new password. 
                        </div>
						<div class="form-group">
							@Html.LabelFor(m => m.PasswordRecoveryEmail, new { @class = "col-sm-3 control-label custom_label" })
							<div class="col-sm-7">
								@Html.TextBoxFor(m => m.PasswordRecoveryEmail, new { @class = "form-control", placeholder="Enter your email" })
								@Html.ValidationMessageFor(m => m.PasswordRecoveryEmail)
                                @if ((Model != null) && (!string.IsNullOrEmpty(Model.PasswordRecoveryMessage)) && (!Model.PasswordRecoveryIsSuccess.HasValue))
                                {
                                    @Html.Raw(Model.PasswordRecoveryMessage)
                                }
							</div>
						</div>
						<div class="form-group">
							<label for="firstName" class="col-sm-3 control-label custom_label">&nbsp;</label>
							<div class="col-sm-7">
								<div class="newsletter_search_btn">
									<button type="submit" class="btn btn-primary">Continue</button>
								</div>
							</div>
						</div>
					</div>  
                    
                    if ((Model != null) && Model.PasswordRecoveryIsSuccess.HasValue)
					{
                        
							<div class="modal fade" id="success-dialog" tabindex="-1" role="dialog" aria-labelledby="add-dialog-label" aria-hidden="true">
								<div class="modal-dialog">
									<div class="modal-content">

										<div class="modal-header">
											<button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
											<h4 class="modal-title" id="success-dialog-label">Password recovery</h4>
										</div>
										<div class="modal-body">
											@Html.Raw(Model.PasswordRecoveryMessage)
										</div>
										<div class="modal-footer">
											<div class="row">
												<div class="col-sm-12">
													<div class="pull-right">
														@Html.ActionLink("OK", "Index", "Home", null, new { @class = "btn btn-default width80" })
													</div>
												</div>
											</div>

										</div>
										<!-- /.modal-content -->
									</div>
									<!-- /.modal-dialog -->
								</div>
							</div>
							<script type="text/javascript">
							    $(function () {
							        $("#success-dialog").modal();
							        $("input[type='text']").val('');
							    });
							</script>
                      
                    }

    }
			</div>
		</div>
	</div>
</div>
